Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(storybook): Remove consideration of mjs from docgen plugin #11346

Merged
merged 4 commits into from
Aug 23, 2024

Conversation

arimendelow
Copy link
Contributor

We created out Storybook framework package by starting with the official framework package for React Vite.

Included in this is a Vite plugin for React Docgen, which is used by Storybook to know what the "controls" are (aka props) for a given component.

This is simply a QOL thing —

With docgen:
Screenshot 2024-08-22 at 14 45 24

Without docgen:
Screenshot 2024-08-22 at 14 43 50

With or without docgen, in order to be able to have interactive controls, you still need to configure them.

Docgen is mostly just used for automatic argType inference.

The docgen plugin that we originally included in our framework package matches components in mjs, tsx, and jsx files. tsx and jsx are obvious requirements, and we didn't give any additional thought to the inclusion of mjs, though it now seems that if you do have any .mjs files that aren't components, it'll completely break your ability to load stories, as discovered by @simoncrypta.

Therefore, this PR simply removes the inclusion of those files.

@simoncrypta
Copy link
Collaborator

Let me try this PR locally, see if that fixed the issue in LeftLane

@Josh-Walker-GM Josh-Walker-GM added this to the next-release milestone Aug 22, 2024
@Josh-Walker-GM Josh-Walker-GM added release:fix This PR is a fix changesets-ok Override the changesets check labels Aug 22, 2024
Copy link
Collaborator

@simoncrypta simoncrypta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works!

packages/storybook/src/preset.ts Outdated Show resolved Hide resolved
@Josh-Walker-GM Josh-Walker-GM enabled auto-merge (squash) August 23, 2024 22:07
@Josh-Walker-GM Josh-Walker-GM merged commit bae7f9d into redwoodjs:main Aug 23, 2024
50 checks passed
dac09 added a commit to dac09/redwood that referenced this pull request Aug 26, 2024
…into feat/rw-uploads-extension

* 'feat/rw-uploads-extension' of github.com:dac09/redwood: (22 commits)
  fix(jobs): Type-safe arguments passing to jobs from scheduler (redwoodjs#11371)
  chore(jobs tests): String literal array for queues (redwoodjs#11370)
  feat(jobs): Expose types (redwoodjs#11369)
  fix(template): Set scripts/ module resolution to match api/ (redwoodjs#11366)
  fix(template): Format tsconfig and jsconfig (redwoodjs#11365)
  fix(tsconfig): set "module" to "ESNext" for web/tsconfig.json (redwoodjs#11368)
  fix(cli): Fix tests generated by `g cell` (redwoodjs#11364)
  chore(deps): bump micromatch to 4.0.8  (redwoodjs#11362)
  chore(deps): bump micromatch to 4.0.8 in create-redwood-rsc-app (redwoodjs#11363)
  Adds docs for how to do recurring jobs (redwoodjs#11361)
  Adds docs for jobs setup and generate commands (redwoodjs#11359)
  feat(storybook): Remove consideration of mjs from docgen plugin (redwoodjs#11346)
  chore(deps): bump micromatch from 4.0.5 to 4.0.8 in /docs (redwoodjs#11358)
  chore(tarsync): Add watch mode to project:tarsync (redwoodjs#11347)
  chore(docs): Move content to main so we can deploy from that branch (redwoodjs#11356)
  chore(jobs test): Remove unused file. Use toContain() (redwoodjs#11355)
  chore(listr2mock): Move comments closer to referenced code (redwoodjs#11354)
  chore(listr2mock): Improve types and make it more capable (redwoodjs#11352)
  chore(jobs): Add e2e test script and CI job (redwoodjs#11348)
  chore(cli tests): Fix include glob (redwoodjs#11351)
  ...
@Josh-Walker-GM Josh-Walker-GM modified the milestones: next-release, v8.0.0 Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changesets-ok Override the changesets check release:fix This PR is a fix
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants